package com.java.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author wmx
 * @create 2020-03-08 19:27
 */
public class DateUtil {
    //将日期转换成固定格式的字符串 YYYY-MM-DD
    public static  String getDateString(Date date,String format){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
        String dateString = simpleDateFormat.format(date);
        return dateString;
    }

}
